n=int(input())
mod=1000000007

#1. 2
#2. 20
#3. 23
#4. 201
#5. 203
#6. 2013

result=[]
result.append([1,0,0,0,0,0])

for i in range(1,n+1):
    next=[]
    next.append(1)
    next.append((result[i-1][0]+result[i-1][1]*2)%mod)
    next.append((result[i-1][0]+result[i-1][2])%mod)
    next.append((result[i-1][1]+result[i-1][3]*2)%mod)
    next.append((result[i-1][1]+result[i-1][2]+result[i-1][4]*2)%mod)
    next.append((result[i-1][3]+result[i-1][4]+result[i-1][5]*2)%mod)
    result.append(next)

print(result[n-1][5])
